import { createApp } from 'vue'
import App from './App.vue'
import 'amfe-flexible'
import '@/styles/index.scss'

import router from './router'
import './router/permission'
import store from './store'
import 'virtual:svg-icons-register'

import request from '@/config/request'
import api from '@/api/index'
import _lodash from '@/utils/_lodash-es'
import _validator from '@/utils/_validator'
import * as utils from '@/utils/index'
import * as dictMeth from '@/utils/dictMeth'
import i18n, { $t } from '@/i18n/index'
import dayjs from 'dayjs'
import echarts from '@/utils/_echarts.js'

import sTitle from '@/components/Title.vue'
// 引入SvgIcon.vue组件
import SvgIcon from '@/components/SvgIcon.vue'

// import VConsole from 'vconsole'

// 在开发测试环境中启用 VConsole
// if (process.env.NODE_ENV === 'development') {
// new VConsole()
// }
const app = createApp(App)

app.config.globalProperties.$request = request
app.config.globalProperties.$api = api
_lodash(app)
_validator(app)
app.config.globalProperties.$utils = utils
app.config.globalProperties.$dictMeth = dictMeth
app.config.globalProperties.$t = $t
app.config.globalProperties.$dayjs = dayjs
app.config.globalProperties.$echarts = echarts

app.component('s-title', sTitle)
app.component('svg-icon', SvgIcon)

app.use(router)
app.use(store)
app.use(i18n)
app.mount('#app')
